﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NewAllArticle.ascx.cs" Inherits="NewAllArticle" %>
<%@ Import Namespace="DTO" %>
<asp:GridView ID="gvwArticles" runat="server" SkinID="Grid"  
    AllowPaging="True" AutoGenerateColumns="False"
   DataKeyNames="ID" DataSourceID="objArticles" ShowHeader="False" Width="100%">
   <Columns>
      <asp:TemplateField HeaderText="Article List (including those not yet published)">
         <HeaderStyle HorizontalAlign="Left" />
         <ItemTemplate>
           <table width="500px" cellpadding="2" cellspacing="2" style="border-bottom:solid 1px #d4d0c8">
                <tr>
                    <td >
                        <span runat="server" id="spanImageUrl" Visible='<%# Eval("IsShowImage") %>'>
                            <div style="padding:2px; border:solid 1px #d4d0c8;" >
                                <asp:Image ID="Image1" ImageUrl='<%# Eval("ImageUrl") %>' runat="server" Width="100px" Height="80px" Visible='<%# Eval("IsShowImage") %>' />                        
                            </div>
                        </span>                            
                    </td>
                    <td style="width:100%" valign="top" align="left" >
                            <table cellpadding="0" cellspacing="0" style="width: 100%;">
                                <tr>
                                     <td>               
                               <div class="titleProduct">
                               <a href='<%#Globals.ApplicationPath%>thoi-trang/<%#Eval("ID")%>/<%#Utils.ConvertToUnSign(DataBinder.Eval(Container.DataItem, "Title").ToString())%>.aspx'/>
                                    <%#Eval("Title")%>
                                </a>
                                  <asp:Image ID="Image2" ImageUrl="~/Images/imgNew.gif" runat="server" Visible='<%# Eval("IsNew") %>' />
                                  </div>
                               <asp:Label runat="server" ID="Literal1" Text='<%# " Ngày đăng : " + Eval("ReleaseDate", "{0:d}") %>' Font-Italic="true" Font-Size="Smaller" />
                               <asp:Label runat="server" ID="Literal2" Text='<%# ", Lượt xem : " + Eval("ViewCount") %>' Font-Italic="true" Font-Size="Smaller" />                                                           
                            </td>                        
                                </tr>
                            </table>
                        <asp:Literal runat="server" ID="lblAbstract" Text='<%# Eval("Abstract") %>' />
                        <div style="width:100%; text-align:right;">
                            <a href='<%#Globals.ApplicationPath%>thoi-trang/<%#Eval("ID")%>/<%#Utils.ConvertToUnSign(DataBinder.Eval(Container.DataItem, "Title").ToString())%>.aspx'/>
                                Chi tiết...
                            </a>                             
                        </div>
                    </td>
                </tr>
            </table>    
         </ItemTemplate>         
      </asp:TemplateField>
   </Columns>   
   <EmptyDataTemplate><b>Chưa có thông tin chia sẻ nào.</b></EmptyDataTemplate>   
</asp:GridView>
<div style="width:100%; text-align:right;padding-right:20px;">

<asp:HyperLink ID="HyperLink1" ForeColor="Red" NavigateUrl="~/bai-viet/1/xu-huong-thoi-trang.aspx" runat="server">
    <asp:Label runat="server" ID="lblAll" Text="Xem tất cả" Font-Size="17px" />
</asp:HyperLink>

</div>
<asp:ObjectDataSource ID="objArticles" runat="server" DeleteMethod="DeleteArticle"
   SelectMethod="ListNewArticles" SelectCountMethod="Articles_GetArticleCount" 
   TypeName="BLL.Article.Article">
   <DeleteParameters>
      <asp:Parameter Name="id" Type="Int32" />
   </DeleteParameters>
</asp:ObjectDataSource>
